from base.model import Model


class Article(Model):
    def __init__(self, items=None):
        fields = ["title", "content", "createdate", "creator", "summary", "url", "source", "category"]
        super().__init__(fields, items)
        if items is not None:
            assert items[0].strip() != "", "article title is blank!"
            assert items[5].strip() != "", "article url is blank!"


if __name__ == '__main__':
    article = Article(["ny_title", "ny_content", "ny_createdate", "ny_creator", "ny_summary", "ny_url"])
    article.set("content", "test-content")
    print(article.list_field())
